import pytest
import argparse

def main():
    parser = argparse.ArgumentParser(description="Run specific pytest cases.")
    parser.add_argument(
        "-k", 
        "--keyword", 
        type=str,
        default="",
        help="Only run tests matching the keyword (e.g., 'test_copy_blocks')",
    )
    parser.add_argument(
        "-s",
        action="store_true",
        help="Disable output capture (show print/logging)",
    )
    args = parser.parse_args()

    # 构造 pytest 参数
    pytest_args = ["-v"]
    if args.keyword:
        pytest_args.extend(["-k", args.keyword])
    if args.s:
        pytest_args.append("-s")

    pytest.main(pytest_args)

if __name__ == "__main__":
    main()
